<template>
  <el-form
    ref="ruleForm"
    :model="ruleForm"
    :rules="rules"
    label-width="120px"
    size="small"
  >
    <el-form-item label="总销售额" prop="totalAmount">
      <el-input v-model.trim="ruleForm.totalAmount" placeholder="请输入总销售额"></el-input>
    </el-form-item>

    <el-form-item label="待结算金额" prop="withdrawableAmount">
      <el-input v-model.trim="ruleForm.withdrawableAmount" placeholder="请输入待结算金额"></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
/* Mixins
------------------------------- */
import { Form } from '@/mixins'

/* Api
------------------------------- */

/* Model
------------------------------- */
import { commanderClearingModel } from '../model'

export default {
  mixins: [Form('ruleForm', commanderClearingModel)],
  data () {
    return {
      ruleForm: Object.assign({}, commanderClearingModel),
      rules: {
        totalAmount: [
          {
            required: true,
            message: this.$t('required', { field: '总销售额' })
          }
        ],
        withdrawableAmount: [
          {
            required: true,
            message: this.$t('required', { field: '待结算金额' })
          }
        ]
      }
    }
  }
}
</script>
